home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 0a | 50 61 74 68 3a 20 75 6e |.lang.c.|Path: un|
|00000020| 64 65 72 67 72 61 64 2e | 6d 61 74 68 2e 75 77 61 |dergrad.|math.uwa|
|00000030| 74 65 72 6c 6f 6f 2e 63 | 61 21 6e 65 77 73 0a 46 |terloo.c|a!news.F|
|00000040| 72 6f 6d 3a 20 4a 6f 73 | 65 20 46 65 6c 69 78 20 |rom: Jos|e Felix |
|00000050| 53 61 6e 64 6f 76 61 6c | 20 3c 6a 66 73 61 6e 64 |Sandoval| <jfsand|
|00000060| 6f 76 3e 0a 53 75 62 6a | 65 63 74 3a 20 52 65 3a |ov>.Subj|ect: Re:|
|00000070| 20 70 72 6f 62 6c 65 6d | 73 20 77 69 74 68 20 61 | problem|s with a|
|00000080| 20 6c 69 6e 6b 65 64 20 | 6c 69 73 74 0a 53 65 6e | linked |list.Sen|
|00000090| 64 65 72 3a 20 6e 65 77 | 73 40 75 6e 64 65 72 67 |der: new|s@underg|
|000000a0| 72 61 64 2e 6d 61 74 68 | 2e 75 77 61 74 65 72 6c |rad.math|.uwaterl|
|000000b0| 6f 6f 2e 63 61 20 28 6e | 65 77 73 20 73 70 6f 6f |oo.ca (n|ews spoo|
|000000c0| 6c 20 6f 77 6e 65 72 29 | 0a 4d 65 73 73 61 67 65 |l owner)|.Message|
|000000d0| 2d 49 44 3a 20 3c 44 4c | 71 77 43 48 2e 39 32 45 |-ID: <DL|qwCH.92E|
|000000e0| 40 75 6e 64 65 72 67 72 | 61 64 2e 6d 61 74 68 2e |@undergr|ad.math.|
|000000f0| 75 77 61 74 65 72 6c 6f | 6f 2e 63 61 3e 0a 44 61 |uwaterlo|o.ca>.Da|
|00000100| 74 65 3a 20 54 68 75 2c | 20 32 35 20 4a 61 6e 20 |te: Thu,| 25 Jan |
|00000110| 31 39 39 36 20 31 36 3a | 32 36 3a 34 30 20 47 4d |1996 16:|26:40 GM|
|00000120| 54 0a 54 6f 3a 20 44 2e | 43 2e 4d 6f 6c 65 72 6f |T.To: D.|C.Molero|
|00000130| 40 64 63 73 2e 77 61 72 | 77 69 63 6b 2e 61 63 2e |@dcs.war|wick.ac.|
|00000140| 75 6b 0a 58 2d 55 72 6c | 3a 20 6e 65 77 73 3a 31 |uk.X-Url|: news:1|
|00000150| 39 39 36 4a 61 6e 32 35 | 2e 31 32 35 33 32 39 2e |996Jan25|.125329.|
|00000160| 32 33 34 39 39 40 64 63 | 73 2e 77 61 72 77 69 63 |23499@dc|s.warwic|
|00000170| 6b 2e 61 63 2e 75 6b 0a | 43 6f 6e 74 65 6e 74 2d |k.ac.uk.|Content-|
|00000180| 54 72 61 6e 73 66 65 72 | 2d 45 6e 63 6f 64 69 6e |Transfer|-Encodin|
|00000190| 67 3a 20 37 62 69 74 0a | 43 6f 6e 74 65 6e 74 2d |g: 7bit.|Content-|
|000001a0| 54 79 70 65 3a 20 74 65 | 78 74 2f 70 6c 61 69 6e |Type: te|xt/plain|
|000001b0| 3b 20 63 68 61 72 73 65 | 74 3d 75 73 2d 61 73 63 |; charse|t=us-asc|
|000001c0| 69 69 0a 52 65 66 65 72 | 65 6e 63 65 73 3a 20 3c |ii.Refer|ences: <|
|000001d0| 31 39 39 36 4a 61 6e 32 | 35 2e 31 32 35 33 32 39 |1996Jan2|5.125329|
|000001e0| 2e 32 33 34 39 39 40 64 | 63 73 2e 77 61 72 77 69 |.23499@d|cs.warwi|
|000001f0| 63 6b 2e 61 63 2e 75 6b | 3e 0a 4e 6e 74 70 2d 50 |ck.ac.uk|>.Nntp-P|
|00000200| 6f 73 74 69 6e 67 2d 48 | 6f 73 74 3a 20 7a 65 6e |osting-H|ost: zen|
|00000210| 6f 30 31 2e 6d 61 74 68 | 2e 75 77 61 74 65 72 6c |o01.math|.uwaterl|
|00000220| 6f 6f 2e 63 61 0a 4d 69 | 6d 65 2d 56 65 72 73 69 |oo.ca.Mi|me-Versi|
|00000230| 6f 6e 3a 20 31 2e 30 0a | 58 2d 4d 61 69 6c 65 72 |on: 1.0.|X-Mailer|
|00000240| 3a 20 4d 6f 7a 69 6c 6c | 61 20 31 2e 31 32 20 28 |: Mozill|a 1.12 (|
|00000250| 58 31 31 3b 20 49 3b 20 | 41 49 58 20 32 29 0a 4f |X11; I; |AIX 2).O|
|00000260| 72 67 61 6e 69 7a 61 74 | 69 6f 6e 3a 20 55 6e 69 |rganizat|ion: Uni|
|00000270| 76 65 72 73 69 74 79 20 | 6f 66 20 57 61 74 65 72 |versity |of Water|
|00000280| 6c 6f 6f 0a 0a 48 65 6c | 6c 6f 2c 0a 49 27 6d 20 |loo..Hel|lo,.I'm |
|00000290| 6e 6f 20 65 78 70 65 72 | 74 20 62 75 74 20 68 65 |no exper|t but he|
|000002a0| 72 65 20 69 74 20 67 6f | 65 73 2e 2e 2e 0a 0a 44 |re it go|es.....D|
|000002b0| 6f 20 79 6f 75 20 68 61 | 76 65 20 61 20 70 69 63 |o you ha|ve a pic|
|000002c0| 74 75 72 65 20 6f 66 20 | 77 68 61 74 20 74 68 65 |ture of |what the|
|000002d0| 20 70 72 6f 67 72 61 6d | 20 64 6f 65 73 2e 2e 2e | program| does...|
|000002e0| 0a 57 68 79 20 69 73 20 | 69 20 61 20 73 74 72 75 |.Why is |i a stru|
|000002f0| 63 74 20 70 6f 69 6e 74 | 65 72 20 3f 3f 3f 20 20 |ct point|er ??? |
|00000300| 49 66 20 69 74 20 69 73 | 20 6f 6e 6c 79 20 74 68 |If it is| only th|
|00000310| 65 20 69 6e 74 20 74 68 | 61 74 20 79 6f 75 20 77 |e int th|at you w|
|00000320| 61 6e 74 20 74 6f 20 73 | 74 6f 72 65 2e 2e 2e 0a |ant to s|tore....|
|00000330| 4f 6e 63 65 20 79 6f 75 | 20 69 6e 73 74 61 6e 74 |Once you| instant|
|00000340| 69 61 74 65 2c 20 6c 65 | 74 73 20 73 61 79 20 61 |iate, le|ts say a|
|00000350| 20 73 74 72 75 63 74 20 | 70 6f 69 6e 74 65 72 20 | struct |pointer |
|00000360| 6e 6f 64 65 2c 20 74 68 | 65 6e 20 79 6f 75 20 6f |node, th|en you o|
|00000370| 6e 6c 79 20 6e 65 65 64 | 20 74 6f 20 0a 66 69 6c |nly need| to .fil|
|00000380| 6c 20 69 74 20 75 70 20 | 77 69 74 68 20 74 68 65 |l it up |with the|
|00000390| 20 72 65 71 75 69 65 72 | 65 64 20 69 6e 66 6f 2e | requier|ed info.|
|000003a0| 20 20 54 68 61 74 20 69 | 73 20 74 68 65 20 69 6e | That i|s the in|
|000003b0| 74 20 61 6e 64 20 74 68 | 65 6e 20 61 20 70 6f 69 |t and th|en a poi|
|000003c0| 6e 74 65 72 20 74 6f 20 | 74 68 65 20 0a 6e 65 78 |nter to |the .nex|
|000003d0| 74 20 6e 6f 64 65 20 69 | 6e 20 74 68 65 20 6c 69 |t node i|n the li|
|000003e0| 73 74 2e 0a 45 67 2e 20 | 5b 30 5d 5b 5d 2d 3e 5b |st..Eg. |[0][]->[|
|000003f0| 31 5d 5b 5d 2d 3e 5b 32 | 5d 5b 5c 5d 20 20 3c 2d |1][]->[2|][\] <-|
|00000400| 2d 20 4e 6f 74 65 20 68 | 65 72 65 20 74 68 61 74 |- Note h|ere that|
|00000410| 20 74 68 65 20 6e 6f 64 | 65 2d 3e 6e 65 78 74 20 | the nod|e->next |
|00000420| 3d 20 4e 55 4c 4c 20 74 | 6f 20 65 6e 64 0a 20 20 |= NULL t|o end. |
|00000430| 20 20 20 5e 0a 20 20 20 | 20 20 7c 0a 20 20 20 4e | ^. | |. N|
|00000440| 6f 64 65 20 70 6f 69 6e | 74 73 20 74 6f 20 74 68 |ode poin|ts to th|
|00000450| 65 20 68 65 61 64 20 6f | 66 20 74 68 65 20 6c 69 |e head o|f the li|
|00000460| 73 74 20 0a 0a 59 6f 75 | 20 77 61 6e 74 20 74 6f |st ..You| want to|
|00000470| 20 61 6c 77 61 79 73 20 | 69 6e 73 65 72 74 20 61 | always |insert a|
|00000480| 74 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |t the be|ginning |
|00000490| 6f 66 20 74 68 65 20 6c | 69 73 74 2c 20 72 69 67 |of the l|ist, rig|
|000004a0| 68 74 20 3f 20 0a 54 68 | 69 73 20 69 73 20 61 20 |ht ? .Th|is is a |
|000004b0| 73 70 65 63 69 61 6c 20 | 63 61 73 65 3a 20 43 72 |special |case: Cr|
|000004c0| 65 61 74 65 20 61 20 74 | 6d 70 4e 6f 64 65 20 61 |eate a t|mpNode a|
|000004d0| 6e 64 20 61 74 74 61 63 | 68 20 69 74 20 74 6f 20 |nd attac|h it to |
|000004e0| 74 68 65 20 6c 69 73 74 | 2e 2e 2e 0a 0a 63 72 65 |the list|.....cre|
|000004f0| 61 74 65 20 61 20 74 6d | 70 4e 6f 64 65 0a 66 69 |ate a tm|pNode.fi|
|00000500| 6c 6c 20 69 74 20 75 70 | 3a 20 74 6d 70 4e 6f 64 |ll it up|: tmpNod|
|00000510| 65 2d 3e 61 20 3d 20 69 | 6e 66 6f 3b 20 77 68 65 |e->a = i|nfo; whe|
|00000520| 72 65 20 69 6e 66 6f 20 | 69 73 20 61 6e 20 69 6e |re info |is an in|
|00000530| 74 2e 2e 2e 0a 43 6f 6e | 6e 65 63 74 20 74 6d 70 |t....Con|nect tmp|
|00000540| 4e 6f 64 65 20 74 6f 20 | 74 68 65 20 6c 69 73 74 |Node to |the list|
|00000550| 3a 0a 09 74 6d 70 4e 6f | 64 65 2d 3e 6e 65 78 74 |:..tmpNo|de->next|
|00000560| 20 3d 20 68 65 61 64 3b | 0a 4d 61 6b 65 20 74 68 | = head;|.Make th|
|00000570| 65 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 20 66 72 6f |e connec|tion fro|
|00000580| 6d 20 68 65 61 64 20 74 | 6f 20 74 6d 70 4e 6f 64 |m head t|o tmpNod|
|00000590| 65 3a 0a 09 68 65 61 64 | 3d 20 74 6d 70 4e 6f 64 |e:..head|= tmpNod|
|000005a0| 65 3b 0a 0a 49 6e 20 6f | 74 68 65 72 20 77 6f 72 |e;..In o|ther wor|
|000005b0| 64 73 3a 0a 76 6f 69 64 | 20 69 6e 73 65 72 74 4e |ds:.void| insertN|
|000005c0| 6f 64 65 28 69 6e 74 20 | 69 6e 66 6f 2c 20 73 74 |ode(int |info, st|
|000005d0| 72 75 63 20 73 69 64 65 | 20 2a 6e 6f 64 65 29 0a |ruc side| *node).|
|000005e0| 7b 0a 20 20 73 74 72 75 | 63 74 20 73 69 64 65 20 |{. stru|ct side |
|000005f0| 74 6d 70 4e 6f 64 65 3b | 0a 0a 09 2f 2f 20 54 77 |tmpNode;|...// Tw|
|00000600| 6f 20 63 61 73 65 73 2c | 20 69 66 20 6e 6f 64 65 |o cases,| if node|
|00000610| 20 3d 20 4e 55 4c 4c 20 | 74 68 65 6e 20 6c 69 73 | = NULL |then lis|
|00000620| 74 20 69 73 20 65 6d 70 | 74 79 0a 09 69 66 20 28 |t is emp|ty..if (|
|00000630| 20 63 6f 64 65 20 3d 20 | 4e 55 4c 4c 20 29 20 7b | code = |NULL ) {|
|00000640| 0a 09 09 2f 2f 61 6c 6c | 6f 63 61 74 65 20 6d 65 |...//all|ocate me|
|00000650| 6d 6f 72 79 20 66 6f 72 | 20 6f 6e 65 20 6e 6f 64 |mory for| one nod|
|00000660| 65 0a 09 09 63 6f 64 65 | 2d 3e 61 20 3d 20 69 6e |e...code|->a = in|
|00000670| 66 6f 3b 0a 09 09 63 6f | 64 65 2d 3e 6e 65 78 74 |fo;...co|de->next|
|00000680| 20 3d 20 4e 55 4c 4c 3b | 0a 09 7d 20 2f 2f 20 57 | = NULL;|..} // W|
|00000690| 65 27 72 65 20 64 6f 6e | 65 20 69 66 20 6c 69 73 |e're don|e if lis|
|000006a0| 74 20 69 73 20 65 6d 70 | 74 79 2e 2e 2e 0a 0a 09 |t is emp|ty......|
|000006b0| 65 6c 73 65 20 7b 20 2f | 2f 20 4c 69 73 74 20 65 |else { /|/ List e|
|000006c0| 78 69 73 74 20 61 6e 64 | 20 59 6f 75 20 77 61 6e |xist and| You wan|
|000006d0| 74 20 74 6f 20 69 6e 73 | 65 72 74 20 61 74 20 74 |t to ins|ert at t|
|000006e0| 68 65 20 62 65 67 69 6e | 6e 69 6e 67 2e 2e 2e 0a |he begin|ning....|
|000006f0| 09 09 2f 2f 20 61 6c 6c | 6f 63 61 74 65 20 6d 65 |..// all|ocate me|
|00000700| 6d 6f 72 79 20 66 6f 72 | 20 6f 6e 65 20 6e 6f 64 |mory for| one nod|
|00000710| 65 2e 2e 2e 0a 09 09 0a | 09 09 2f 2f 20 54 68 69 |e.......|..// Thi|
|00000720| 73 20 69 73 20 74 6d 70 | 4e 6f 64 65 0a 09 09 74 |s is tmp|Node...t|
|00000730| 6d 70 4e 6f 64 65 2d 3e | 61 20 3d 20 69 6e 66 6f |mpNode->|a = info|
|00000740| 3b 20 20 2f 2f 20 46 69 | 6c 6c 20 69 74 20 75 70 |; // Fi|ll it up|
|00000750| 2e 2e 2e 0a 0a 09 09 2f | 2f 20 43 6f 6e 6e 65 63 |......./|/ Connec|
|00000760| 74 20 66 72 6f 6d 20 74 | 68 65 20 74 65 6d 70 20 |t from t|he temp |
|00000770| 6e 6f 64 65 2e 2e 2e 0a | 09 09 74 6d 70 4e 6f 64 |node....|..tmpNod|
|00000780| 65 2d 3e 6e 65 78 74 20 | 3d 20 6e 6f 64 65 3b 20 |e->next |= node; |
|00000790| 0a 0a 09 09 2f 2f 20 63 | 68 61 6e 67 65 20 74 68 |....// c|hange th|
|000007a0| 65 20 68 65 61 64 20 6e | 6f 77 20 73 6f 20 74 68 |e head n|ow so th|
|000007b0| 65 20 66 69 72 73 74 20 | 6e 6f 64 65 20 69 73 20 |e first |node is |
|000007c0| 74 68 65 20 6e 65 77 6c | 79 20 63 72 65 61 74 65 |the newl|y create|
|000007d0| 64 20 0a 09 09 2f 2f 20 | 6e 6f 64 65 2e 20 20 54 |d ...// |node. T|
|000007e0| 68 69 73 20 69 73 20 62 | 65 63 61 75 73 65 20 77 |his is b|ecause w|
|000007f0| 65 27 72 65 20 69 6e 73 | 65 72 74 69 6e 67 20 61 |e're ins|erting a|
|00000800| 74 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |t the be|ginning |
|00000810| 6f 66 0a 09 09 2f 2f 20 | 74 68 65 20 6c 69 73 74 |of...// |the list|
|00000820| 0a 09 09 6e 6f 64 65 20 | 3d 20 74 6d 70 4e 6f 64 |...node |= tmpNod|
|00000830| 65 3b 0a 09 7d 20 2f 2f | 20 57 65 27 72 65 20 64 |e;..} //| We're d|
|00000840| 6f 6e 65 2e 2e 2e 0a 7d | 20 2f 2f 20 69 6e 73 65 |one....}| // inse|
|00000850| 72 74 4e 6f 64 65 0a 0a | 53 6f 20 6e 6f 77 20 6d |rtNode..|So now m|
|00000860| 61 69 6e 20 73 68 6f 75 | 6c 64 20 6c 6f 6f 6b 20 |ain shou|ld look |
|00000870| 6c 69 6b 65 3a 0a 69 6e | 74 20 6d 61 69 6e 28 29 |like:.in|t main()|
|00000880| 0a 7b 0a 09 73 74 72 75 | 63 74 20 73 69 64 65 20 |.{..stru|ct side |
|00000890| 2a 6e 6f 64 65 3b 0a 09 | 0a 09 6e 6f 64 65 20 3d |*node;..|..node =|
|000008a0| 20 4e 55 4c 4c 3b 20 20 | 2f 2f 20 69 6e 69 74 69 | NULL; |// initi|
|000008b0| 61 74 65 20 6e 6f 64 65 | 0a 09 0a 09 69 6e 73 65 |ate node|....inse|
|000008c0| 72 74 4e 6f 64 65 28 30 | 2c 20 6e 6f 64 65 29 3b |rtNode(0|, node);|
|000008d0| 20 20 2f 2f 20 49 6e 73 | 65 72 74 20 30 20 74 6f | // Ins|ert 0 to|
|000008e0| 20 74 68 65 20 6c 69 73 | 74 2e 2e 2e 0a 09 69 6e | the lis|t.....in|
|000008f0| 73 65 72 74 4e 6f 64 65 | 28 31 2c 20 6e 6f 64 65 |sertNode|(1, node|
|00000900| 29 3b 0a 09 69 6e 73 65 | 72 74 4e 6f 64 65 28 32 |);..inse|rtNode(2|
|00000910| 2c 20 6e 6f 64 65 29 3b | 0a 09 72 65 74 75 72 6e |, node);|..return|
|00000920| 20 30 3b 0a 7d 20 2f 2f | 20 6d 61 69 6e 0a 0a 54 | 0;.} //| main..T|
|00000930| 72 61 63 69 6e 67 20 74 | 68 65 20 69 6e 73 65 72 |racing t|he inser|
|00000940| 4e 6f 64 65 20 66 75 6e | 63 74 69 6f 6e 20 79 6f |Node fun|ction yo|
|00000950| 75 27 64 20 68 61 76 65 | 3a 0a 69 6e 73 65 72 74 |u'd have|:.insert|
|00000960| 4e 6f 64 65 28 30 2c 20 | 6e 6f 64 65 29 0a 6e 6f |Node(0, |node).no|
|00000970| 64 65 20 69 73 20 6e 75 | 6c 6c 20 61 6e 64 20 6c |de is nu|ll and l|
|00000980| 6f 6f 6b 73 20 6c 69 6b | 65 20 20 5b 5c 5d 0a 74 |ooks lik|e [\].t|
|00000990| 68 65 6e 20 74 68 65 20 | 66 69 72 73 74 20 69 66 |hen the |first if|
|000009a0| 20 73 74 61 74 65 6d 65 | 6e 74 20 69 73 20 65 78 | stateme|nt is ex|
|000009b0| 65 63 75 74 65 64 20 61 | 6e 64 20 77 65 27 64 20 |ecuted a|nd we'd |
|000009c0| 68 61 76 65 3a 0a 09 5b | 5d 5b 5d 20 20 2f 2f 61 |have:..[|][] //a|
|000009d0| 6c 6c 6f 63 61 74 65 20 | 6d 65 6d 6f 72 79 0a 09 |llocate |memory..|
|000009e0| 5b 30 5d 5b 5d 20 20 2f | 2f 20 70 75 74 20 74 68 |[0][] /|/ put th|
|000009f0| 65 20 69 6e 66 6f 20 69 | 6e 20 69 74 0a 09 5b 30 |e info i|n it..[0|
|00000a00| 5d 5b 5c 5d 20 2f 2f 20 | 74 65 72 6d 69 6e 61 74 |][\] // |terminat|
|00000a10| 65 20 66 69 72 73 74 20 | 6e 6f 64 65 2e 2e 2e 0a |e first |node....|
|00000a20| 0a 69 6e 73 65 72 74 4e | 6f 64 65 28 31 2c 20 6e |.insertN|ode(1, n|
|00000a30| 6f 64 65 29 0a 6e 6f 64 | 65 20 69 73 20 6e 6f 74 |ode).nod|e is not|
|00000a40| 20 6e 75 6c 6c 2c 20 74 | 68 65 6e 20 74 68 65 20 | null, t|hen the |
|00000a50| 65 6c 73 65 20 63 6f 6e | 64 69 74 69 6f 6e 20 69 |else con|dition i|
|00000a60| 73 20 6d 65 74 2e 2e 2e | 48 65 6e 63 65 20 77 65 |s met...|Hence we|
|00000a70| 20 68 61 76 65 3a 0a 09 | 5b 30 5d 5b 5c 5d 0a 41 | have:..|[0][\].A|
|00000a80| 74 20 74 68 69 73 20 70 | 6f 69 6e 74 20 63 72 65 |t this p|oint cre|
|00000a90| 61 74 65 20 61 20 6e 65 | 77 20 74 6d 70 4e 6f 64 |ate a ne|w tmpNod|
|00000aa0| 65 20 74 6f 20 66 69 6c | 6c 20 75 70 2e 2e 2e 0a |e to fil|l up....|
|00000ab0| 09 5b 30 5d 5b 5c 5d 20 | 20 20 20 3c 2d 2d 2d 4e |.[0][\] | <---N|
|00000ac0| 6f 64 65 0a 09 5b 5d 5b | 5d 20 20 20 20 20 20 3c |ode..[][|] <|
|00000ad0| 2d 2d 2d 74 6d 70 4e 6f | 64 65 0a 46 69 6c 6c 20 |---tmpNo|de.Fill |
|00000ae0| 69 74 20 75 70 2e 2e 2e | 0a 09 5b 30 5d 5b 5c 5d |it up...|..[0][\]|
|00000af0| 0a 09 5b 31 5d 5b 5d 20 | 20 2f 2f 20 66 69 6c 6c |..[1][] | // fill|
|00000b00| 20 75 70 20 77 69 74 68 | 20 69 6e 66 6f 2e 2e 2e | up with| info...|
|00000b10| 0a 4e 6f 77 20 63 6f 6e | 6e 65 63 74 20 66 72 6f |.Now con|nect fro|
|00000b20| 6d 20 6e 6f 64 65 20 74 | 6f 20 74 6d 70 4e 6f 64 |m node t|o tmpNod|
|00000b30| 65 3a 0a 09 5b 31 5d 5b | 5d 2d 3e 5b 30 5d 5b 5c |e:..[1][|]->[0][\|
|00000b40| 5d 0a 43 68 61 6e 67 65 | 20 74 68 65 20 6e 6f 64 |].Change| the nod|
|00000b50| 65 28 77 68 69 63 68 20 | 69 73 20 74 68 65 20 68 |e(which |is the h|
|00000b60| 65 61 64 20 6f 66 20 74 | 68 65 20 6c 69 73 74 20 |ead of t|he list |
|00000b70| 74 6f 20 62 65 20 6e 6f | 77 20 74 68 65 20 74 6d |to be no|w the tm|
|00000b80| 70 4e 6f 64 65 20 6a 75 | 73 74 0a 63 72 65 61 74 |pNode ju|st.creat|
|00000b90| 65 64 0a 48 65 6e 63 65 | 20 77 65 20 68 61 76 65 |ed.Hence| we have|
|00000ba0| 3a 0a 09 5b 31 5d 5b 5d | 2d 3e 5b 30 5d 5b 5c 5d |:..[1][]|->[0][\]|
|00000bb0| 0a 09 20 5e 0a 09 20 7c | 0a 09 6e 6f 64 65 0a 41 |.. ^.. ||..node.A|
|00000bc0| 6e 64 20 74 68 65 20 73 | 61 6d 65 20 66 6f 72 20 |nd the s|ame for |
|00000bd0| 61 6e 79 20 6f 74 68 65 | 72 20 63 61 73 65 73 2e |any othe|r cases.|
|00000be0| 2e 2e 0a 0a 48 6f 70 65 | 20 74 68 69 73 20 68 65 |....Hope| this he|
|00000bf0| 6c 70 73 2e 2e 2e 0a 4e | 6f 74 65 20 74 68 61 74 |lps....N|ote that|
|00000c00| 20 61 20 74 6f 20 69 6e | 73 65 72 74 20 69 6e 74 | a to in|sert int|
|00000c10| 6f 20 61 20 6c 69 6e 6b | 20 6c 69 73 74 20 79 6f |o a link| list yo|
|00000c20| 75 20 6d 61 79 20 63 6f | 6d 65 20 74 6f 20 66 61 |u may co|me to fa|
|00000c30| 63 65 20 77 69 74 68 20 | 74 68 72 65 65 20 63 61 |ce with |three ca|
|00000c40| 73 65 73 2e 2e 2e 0a 49 | 6e 73 65 72 74 20 61 74 |ses....I|nsert at|
|00000c50| 20 74 68 65 20 62 65 67 | 69 6e 6e 69 6e 67 20 6f | the beg|inning o|
|00000c60| 66 20 74 68 65 20 6c 69 | 73 74 2c 20 74 68 65 20 |f the li|st, the |
|00000c70| 65 6e 64 2c 20 61 6e 64 | 20 74 68 65 20 6d 69 64 |end, and| the mid|
|00000c80| 64 6c 65 2e 2e 2e 0a 54 | 68 65 20 66 69 72 73 74 |dle....T|he first|
|00000c90| 20 74 77 6f 20 6e 65 65 | 64 20 61 20 6c 69 74 74 | two nee|d a litt|
|00000ca0| 6c 65 20 62 69 74 20 6d | 6f 72 65 20 63 61 72 65 |le bit m|ore care|
|00000cb0| 2e 2e 2e 42 75 74 20 74 | 68 65 20 74 68 72 65 65 |...But t|he three|
|00000cc0| 20 6f 66 20 74 68 65 6d | 20 68 61 76 65 20 0a 74 | of them| have .t|
|00000cd0| 68 65 20 6e 61 6d 65 20 | 61 6e 61 6c 6f 67 79 20 |he name |analogy |
|00000ce0| 61 73 20 74 6f 20 74 68 | 65 20 69 6e 73 65 72 74 |as to th|e insert|
|00000cf0| 4e 6f 64 65 28 29 20 66 | 75 6e 63 74 69 6f 6e 20 |Node() f|unction |
|00000d00| 64 65 73 63 72 69 62 65 | 64 20 61 62 6f 76 65 2e |describe|d above.|
|00000d10| 2e 2e 0a 0a 47 6f 6f 64 | 20 6c 75 63 6b 2e 2e 2e |....Good| luck...|
|00000d20| 0a 2d 2d 20 0a 4a 6f 73 | 65 20 53 61 6e 64 6f 76 |.-- .Jos|e Sandov|
|00000d30| 61 6c 20 7c 20 6a 66 73 | 61 6e 64 6f 76 40 75 77 |al | jfs|andov@uw|
|00000d40| 61 74 65 72 6c 6f 6f 2e | 63 61 0a 0a |aterloo.|ca.. |
+--------+-------------------------+-------------------------+--------+--------+